package com.atguigu.mediator.smarthouse;

/**
 * 同事类实现类 ： CoffeeMachine 咖啡机
 */
public class ColleagueForCoffeeMachine extends Colleague {

	public ColleagueForCoffeeMachine(Mediator mediator, String name) {
		super(mediator, name);
		mediator.register(name, this);
	}

	@Override
	public void sendMessage(int stateChange) {
		this.getMediator().getMessage(stateChange, this.name);
	}

	/**
	 * CoffeeMachine 自定义方法
	 */
	public void startCoffee() {
		System.out.println("开始启动咖啡机");
	}

	/**
	 * CoffeeMachine 自定义方法
	 */
	public void finishCoffee() {
		System.out.println("等5分钟后");
		System.out.println("咖啡做好了");
		sendMessage(0);
	}
}
